Carbon


FSpRename

Header: Files.h Carbon status: Supported

Renames a file or directory.

OSErr FSpRename (
    const FSSpec *spec, 
    ConstStr255Param newName
);
spec

A pointer to an FSSpec structure specifying the file or directory to rename.

newName

The new name of the file or directory.

function result

A result code.

DISCUSSION

If a file ID reference for the specified file exists, it remains with the renamed file.

If you want to change the name of a new copy of an existing file, you should use the FSpExchangeFiles function instead.

AVAILABILITY

Supported in Carbon. Available in Mac OS 8.1 and later when Carbon 1.0.2 or later is present.


© 2000 Apple Computer, Inc. — (Last Updated 5/8/2000)